/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


$(document).ready(function(e){
    //this for the menu
//    $("#homeSubMenu").show("slow").siblings().hide("slow");
    $('#mainNavigation > li > a > span').removeClass("main-menu-highlight");
    $("#subjectReservationMenu > span").addClass("main-menu-highlight");
//    $('.gen-menu-ul > li > a > span').removeClass("sub-menu-highlight");
//    $(".gen-menu-ul > li > a > #sendRequest").addClass("sub-menu-highlight");
    
});
function reloadSubjectOffering(){
    
}
$.subscribe('reloadSubjectOffering', function() {
    $("#gridSubjectOfferings").jqGrid('setGridParam',{
                url:"/CBSROnline/subjects/view~subjectoffering-blocks?subjectOfferingID="+$("#subjectOfferingID").val()
            }).trigger('reloadGrid');
});
function reserveSubjects() {
    $('#confirmationDialog').dialog('close');
    var selectedId = $("#gridSubjectOfferings").jqGrid('getGridParam','selrow');
    alert(selectedId);
//    if(selectedId != null){
//        $("#loadingIndication").html("<img class=\"gen-full-width\" src=\"images/ajax-loader.gif\" />");
//        $("#loadingIndication").dialog('open');
//        $.getJSON("/cashmatecreditcorporation/send request/send" ,
//        {
//            'id': selectedId
//        },
//        function(json) {
//            $("#loadingIndication").html("");
//            $("#loadingIndication").dialog('close');
//            promptJSONMessage("#loanRequestDialog", json);
//            $("#gridLoanRequests").trigger("reloadGrid");
//
//        }
//        ); 
//    }
}